package com.workpaper.app.plan.actions;

import org.eclipse.jface.action.Action;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.ResourceLocator;
import org.eclipse.jface.window.Window;

import com.workpaper.app.cache.resource.ViewInfoCache;
import com.workpaper.app.consts.AppConsts;
import com.workpaper.app.consts.common.CommonViewConsts;
import com.workpaper.app.consts.resources.IconPath;
import com.workpaper.app.plan.view.DailyPlanAddDialog;

public class AddDailyPlanAction extends Action{

	public AddDailyPlanAction() {
		this(ViewInfoCache.get(CommonViewConsts.ButtonText_Add), ResourceLocator.imageDescriptorFromBundle(AppConsts.APP_ID, IconPath.BtnIcon_add).get());
		
	}
	
	private AddDailyPlanAction(String text, ImageDescriptor image) {
		super(text, image);
	}

	@Override
	public void run() {
		DailyPlanAddDialog planEditDialog = new DailyPlanAddDialog(null);
		int resultCode = planEditDialog.open();
		if(resultCode == Window.OK) {
			System.out.println("正常关闭.....");
		}
		System.out.println("新增弹框");
		super.run();
	}
}
